from flask import current_app, jsonify
from flask import g
from flask import render_template
from flask import request

from info import db
from info.models import User, Order
from info.modules.profile import profile_blu
from info.utils.common import user_login
from info.utils.response_code import RET




# @profile_blu.route("/user/auth")
# def auth():
#     return render_template("")

#
# @profile_blu.route("/user/houses")
# @user_login
# def myhouses():
#     """
#     我的房源
#     :return:
#     """
#     # user = g.user
#     # user_id = 7
#     User.id = 7
#     # user_id = user.id
#     # # user_id = user.id
#     try:
#         user = User.query.get(User.id)
#         houses = user.houses
#     except Exception as e:
#         current_app.logger.error(e)
#         return jsonify(errno=RET.DBERR, errmsg="获取数据失败")
#     houses_list = []
#     for house in houses:
#         houses_list.append(house.to_basic_dict())
#     print(houses_list)
#     data = {
#         "houses_list":houses_list
#     }
#     print(data)
#     # return render_template("../../static/html/myhouse.html", data=data)
#     return jsonify(errno=RET.OK, errmsg="ok", data=data)


# @profile_blu.route("/user/my")
# @user_login
# def my():
    # return render_template("../../static/html/my.html")